package com.ctgu.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ctgu.demo.entity.Pudding;
import com.ctgu.demo.service.PuddingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: PuddingController
 * @description:
 * @author: gh
 * @create: 2020-06-22 12:24
 **/
@CrossOrigin(allowCredentials = "true", allowedHeaders = "*")
@RestController
@RequestMapping("/pudding")
public class PuddingController {

    @Autowired
    PuddingService puddingService;

    @RequestMapping("/getPuddingAll")
    public List<Pudding> getPuddingAll(){
        QueryWrapper<Pudding> wrapper =new QueryWrapper<Pudding>();
        wrapper.select("*");
        List<Pudding> list= puddingService.list(wrapper);
        return list;
    }
}
